﻿using System;
using System.Linq;
using System.Activities;
using System.Activities.Statements;
using System.Collections.Generic;

namespace OrderHandlingWorkflow
{
    class Program
    {
        static void Main(string[] args)
        {
            Customer customer = new Customer(1, "Søren", "Rued Langgaardsvej 7", 12345, 987634429984);

            Item item1 = new Item(1, "Madpakke med ost", "Mad", 30);
            Item item2 = new Item(2, "Pizza med skinke og ost", "Vesuvio", 45);
            Item item3 = new Item(3, "En kasse Coca Cola", "Cola", 332);
            Item item4 = new Item(4, "En stor softice", "Is", 56);
            List<Item> items = new List<Item>() { item1, item2, item3, item4 };

            Order order = new Order(1, items, customer);

            Dictionary<string, object> arguments = new Dictionary<string, object>();
            arguments.Add("order", order);
            try
            {
                WorkflowInvoker.Invoke(new Workflow1(), arguments);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            Console.WriteLine("Press ENTER to exit...");
            Console.ReadLine();
        }
    }
}
